package com.xuyixuan.do_jdbc;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ServiceUser {

    @Autowired
    private MapperUser mapperuser;

    public int addUser(EntityUser user) {
        return mapperuser.addUser(user);
    }

    public EntityUser getUserById(int id) {
        return mapperuser.getUserById(id);
    }

    public int updateUser(EntityUser user) {
        return mapperuser.updateUser(user);
    }

    public int deleteUser(int id) {
        return mapperuser.deleteUser(id);
    }

    public List<EntityUser> getAllUsers() {
        return mapperuser.getAllUsers();
    }
}